package com.weitu.threeSimultaneities.safe.service.impl;

import com.weitu.threeSimultaneities.safe.entity.SafeAcceptance;
import com.weitu.threeSimultaneities.safe.mapper.SafeAcceptanceMapper;
import com.weitu.threeSimultaneities.safe.service.SafeAcceptanceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class SafeAcceptanceServiceImpl implements SafeAcceptanceService {
    @Autowired
    private SafeAcceptanceMapper safeAcceptanceMapper;

    private static final Logger logger = LoggerFactory.getLogger(SafeAcceptanceServiceImpl.class);

    @Override
    public SafeAcceptance selectByPrimaryKey(String id) {
        return this.safeAcceptanceMapper.selectByPrimaryKey(id);
    }

    @Override
    public int deleteBySubjectId(String id) {
        return this.safeAcceptanceMapper.deleteBySubjectId(id);
    }
    @Override
    public int updateByPrimaryKeySelective(Map paramMap) {
        return this.safeAcceptanceMapper.updateByPrimaryKeySelective(paramMap);
    }
    @Override
    public int insertSelective(Map paramMap) {
        this.safeAcceptanceMapper.deleteBySubjectId(paramMap.get("subjectId").toString());
        return this.safeAcceptanceMapper.insertSelective(paramMap);
    }

    @Override
    public SafeAcceptance selectBySubjectId(String id) {
        return this.safeAcceptanceMapper.selectBySubjectId(id);
    }
}